package cn.edu.zafu.bigdata.lyq.work4;

import java.sql.SQLOutput;

public class StaticDemo {
    static int count;
    int id;
    static{
        System.out.println("Static block executed");
        count = 0;
    }
    {
        System.out.println("Instance block executed");
        id = count;
        count++;
    }
    public StaticDemo(){
        System.out.println("Constructor executed for ID: " + id);
    }
    public static void displayCount(){
        System.out.println("当前创造了"+ count + "个实例");
    }
}
